package com.gitee.wsl.mathematics.function.noise.d2

import com.gitee.wsl.mathematics.function.noise.Noise2d

class LayeredNoise2d : Noise2d {
    val layers = mutableListOf<Noise2d>()

    override fun eval(x: Float, y: Float): Float {
        var result = 0f
        for (i in layers.indices) {
            result += layers[i].eval(x, y)
        }
        return result
    }
}

fun Noise2d.Companion.layered() =  LayeredNoise2d()